package com.example;

import com.example.conditional.ListService;
import com.example.properties.Author;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
public class DemoApplication {

  @Autowired
  private DemoPublisher demoPublisher;


  @Qualifier("linuxListService")
  @Autowired
  private ListService listService;

  @Autowired
  private ApplicationContext applicationContext;

  @Autowired
  private Author author;

  @Autowired
  private AwareService awareService;
	@GetMapping("/demo")
	public String test(){
    demoPublisher.publish("woooooooooooo");
    awareService.outputResult();
    System.out.println(applicationContext.getEnvironment().getProperty("os.name")+"系统命令是： "+listService.showListCmd());
    System.out.println(author);
    return "dddddd";
	}



	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
	}


}
